Skip to content

Replace personal PAT with GITHUB_TOKEN in versioning workflow#1530

Merged
vahid-ahmadi merged 1 commit intomainfrom
fix-versioning-workflow
Mar 17, 2026
Merged

Replace personal PAT with GITHUB_TOKEN in versioning workflow#1530
vahid-ahmadi merged 1 commit intomainfrom
fix-versioning-workflow

Conversation

@vahid-ahmadi
Copy link
Collaborator

Summary

  • Replaced secrets.POLICYENGINE_GITHUB (expired personal PAT) with GITHUB_TOKEN for same-repo checkout and push in the Versioning job
  • Restructured Publish as a sequential job (needs: Versioning) instead of relying on a re-triggered push event, since GITHUB_TOKEN pushes don't trigger new workflow runs
  • Made the cross-repo update_api.py step conditional on POLICYENGINE_GITHUB secret availability so core versioning + PyPI publish works without any PAT

Context

The versioning workflow was failing because secrets.POLICYENGINE_GITHUB (a personal PAT) expired. The old design required the PAT to push a commit that re-triggered the workflow for the Publish job. This redesign eliminates that dependency for same-repo operations.

Note: Cross-repo API updates (update_api.py which bumps policyengine-api and policyengine-household-api) still need a token with cross-repo access. Consider creating an org-scoped fine-grained PAT or GitHub App for this.

Test plan

  • Changelog entry included to trigger versioning on merge
  • Verify Versioning job succeeds with GITHUB_TOKEN after merge
  • Verify Publish job runs sequentially and publishes to PyPI

Closes the versioning failure from https://github.com/PolicyEngine/policyengine-uk/actions/runs/23208707049

🤖 Generated with Claude Code

The Versioning job previously required secrets.POLICYENGINE_GITHUB (a
personal PAT) to push the version bump commit and re-trigger the Publish
job. This broke when the PAT expired.

Changes:
- Use GITHUB_TOKEN with contents:write for same-repo checkout/push
- Restructure Publish as needs:Versioning sequential job instead of
  relying on a re-triggered push event (GITHUB_TOKEN pushes don't
  trigger new workflow runs)
- Make cross-repo update_api.py conditional on POLICYENGINE_GITHUB
  secret availability

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vahid-ahmadi vahid-ahmadi merged commit 6fdf59b into main Mar 17, 2026
3 checks passed
@vahid-ahmadi vahid-ahmadi deleted the fix-versioning-workflow branch March 17, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant